package cn.hn.tx.rebot.task.service.impl;

import java.util.List;
import java.util.Map;

import cn.hn.comm.ibatis.BaseDAO;
import cn.hn.tx.rebot.task.model.TaskExeLog;
import cn.hn.tx.rebot.task.service.ITaskService;

public class TaskServiceImpl implements ITaskService {
	final String NAMESPACE = "cn.hn.tx.rebot.task.dao";

	// DAO基类
	private BaseDAO baseDAO;

	/**
	 * 插入任务执行日志
	 * 
	 * @param taskExeLog
	 */
	public void insertTaskExeLog(TaskExeLog taskExeLog) {
		baseDAO.insert(NAMESPACE, "insertTaskExeLog", taskExeLog);
	}

	public List<Map<String, Object>> getTaskList() {
		try {
			List<Map<String, Object>> listTask = baseDAO.queryList(NAMESPACE,
					"queryRebotTaskList", null);
			return listTask;
		} catch (Exception e) {
			e.printStackTrace();
			return null;
		}

	}

	public void updateTask(Map<String, Object> params) {
		baseDAO.update(NAMESPACE, "updateRebotTask", params);
	}

	public BaseDAO getBaseDAO() {
		return baseDAO;
	}

	public void setBaseDAO(BaseDAO baseDAO) {
		this.baseDAO = baseDAO;
	}

}
